#include<iostream>
#include<unistd.h>
#include<signal.h>

using namespace std;

void handler(int signo)
{
    cout<<"...get a sig,number:"<<signo<<endl;
}

int main()
{
    signal(SIGALRM,handler);
    int n=alarm(5);

    while(true)
    {
        cout<<"proc is running,pid:"<<getpid()<<endl;
    }
    
}